package com.sikulifang.bank.simulation.util;

import cn.hutool.core.thread.ThreadUtil;
import com.sikulifang.bank.simulation.server.service.IServerHandler;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * ClassName IServerHandlerUtils
 * Description IServerHandlerUtils
 *
 * @author Yat
 * Date 2023/5/30 11:37
 * version 1.0
 */
public class IServerHandlerUtils {
    public static final ConcurrentMap<String, IServerHandler> SERVER_MAP = new ConcurrentHashMap<>();

    public static final ExecutorService EXECUTOR_SERVICE = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
            60L, TimeUnit.SECONDS, new SynchronousQueue<>(),
            ThreadUtil.newNamedThreadFactory("ELQ-NETTY-", Boolean.FALSE));
}
